package com.avicit.zipkinkafkaesserver.dao;

import com.avicit.zipkinkafkaesserver.entity.ZipkinInterfaceCount;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface ZipkinInterfaceCountDao  extends JpaRepository<ZipkinInterfaceCount,Long>, JpaSpecificationExecutor<ZipkinInterfaceCount> {
    @Query("select  z from ZipkinInterfaceCount z where z.serverName = :serverName and z.queryDate = :queryDate and z.interfacePath = :interfacePath and z.interfaceMethods = :interfaceMethod" )
    ZipkinInterfaceCount findByItems(@Param(value = "serverName") String serverName,
                                     @Param(value = "queryDate") String queryDate,
                                     @Param(value = "interfacePath") String interfacePath,
                                     @Param(value = "interfaceMethod") String interfaceMethod);

}
